#ifndef COMMON
#define COMMON
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#ifndef _MSC_VER
#if __BYTE_ORDER == __BIG_ENDIAN
#define TOBIGS(VAR) (uint16_t)((VAR<<8)|(VAR>>8))
#define TOBIGL(VAR) (uint32_t)((VAR<<24)|(VAR>>24)|((VAR<<8)&0x00FF0000)|((VAR>>8)&0x0000FF00))
#define BE
#define BEDOUBLE 7
#else
#define TOBIGS(VAR) (uint16_t)VAR
#define TOBIGL(VAR) (uint32_t)VAR
#define BEDOUBLE 0
#endif
typedef long long INT;
#else
#define TOBIGS(VAR) (uint16_t)VAR
#define TOBIGL(VAR) (uint32_t)VAR
#define BEDOUBLE 0
typedef __int64 INT;
#endif
#pragma pack(1)
typedef unsigned char BYTE;
typedef uint16_t WORD;
typedef uint32_t DWORD;
typedef char CHAR;
typedef unsigned char* PBYTE;
typedef char* PSTR;
typedef double DOUBLE;
#endif

